﻿<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY copy "&#169;">
  <!ENTITY nbsp "&#160;">
  <!ENTITY laquo "&#171;">
  <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">


  <xsl:include href="../layout.xsl"/>

  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="content">
    <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript" src="/js/tiny_mce/tiny_config.js"></script>

    <link href="/js/swfupload/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/swfupload/swfupload.js"></script>
    <script type="text/javascript" src="/js/swfupload/form/fileprogress.js"></script>
    <script type="text/javascript" src="/js/swfupload/form/handlers.js"></script>
    <script type="text/javascript" src="/js/swfupload/form/config.js"></script>

    <!--<link href="/js/swfupload/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/swfupload/swfupload.js"></script>

    <script type="text/javascript" src="/js/swfupload/form/fileprogress.js"></script>
    <script type="text/javascript" src="/js/swfupload/form/handlers.js"></script>
    <script type="text/javascript" src="/js/swfupload/form/config.js"></script>-->

    <!--<script type="text/javascript" src="/js/swfupload/fileprogress.js"></script>-->
    <!--<script type="text/javascript" src="/js/swfupload/handlers.js"></script>
    <script type="text/javascript" src="/js/swfupload/handlers_editor.js"></script>
    <script type="text/javascript" src="/js/swfupload/config.js"></script>-->

    <div class="contenthead">
      <input type="hidden" id="upload_url" value="/{$Controller}/uploadphotos/id/{$Form/id}"/>


      <xsl:call-template name="Create_Path">
        <xsl:with-param name="last" select="/page/content/Main/form/title"></xsl:with-param>
      </xsl:call-template>
      <div class="top">
        <span class="title">
          <xsl:value-of select="$Cats/row[id=$Content/@cat]/title" />
        </span>
      </div>
    </div>

    <form action="" method="post" name="form" id="form" enctype="multipart/form-data" >

      <div class="aside">
        <xsl:call-template name="Box-Avatar" />
        <xsl:call-template name="Box-CEO" />

        <div class="head-slide on">
          Настройки
        </div>
        <div class="container">
          <ul class="editlist">
            <li>

              <label>
                ID Title (<a href="javascript:;" onclick="refreshIDT({$Main/@id}, '{$Controller}')">Генерировать из названия меню</a>)
              </label>

              <input name="idt" type="text" value="{$Form/idt}" class="broad100" id="idt"/>

            </li>
            <li>
              <ul>
                <li>
                  <input name="is_active" type="checkbox" value="1">
                    <xsl:if test="$Form/is_active = 1">
                      <xsl:attribute name="checked">checked</xsl:attribute>
                    </xsl:if>
                  </input>
                  Активная
                </li>
                <li>
                  <input name="is_top" type="checkbox" value="1">
                    <xsl:if test="$Form/is_top = 1">
                      <xsl:attribute name="checked">checked</xsl:attribute>
                    </xsl:if>
                  </input>
                  Топ
                </li>
                <li>
                  <input name="is_public" type="checkbox" value="1">
                    <xsl:if test="$Form/is_public = 1">
                      <xsl:attribute name="checked">checked</xsl:attribute>
                    </xsl:if>
                  </input>
                  Публікувати
                </li>                
              </ul>
            </li>      

          </ul>



        </div>

      </div>


      <div class="article">





        <xsl:call-template name="Article-edit-switcher">
          <xsl:with-param name="active">1</xsl:with-param>
        </xsl:call-template>

        <xsl:call-template name="Messages" />

        <fieldset>

          <input type="hidden" id="id" value="{$Form/id}" rel="id_article"/>





          <ul class="editlist">

            <xsl:if test="$Form/id_cat/row">
              <li>
                <label class="floatleft">Рубрика</label>
                <select name="id_cat" id="id_cat">
                  <xsl:for-each select="$Form/id_cat/row">
                    <option value="{id}">
                      <xsl:if test="@active">
                        <xsl:attribute name="selected">selected</xsl:attribute>
                      </xsl:if>
                      <xsl:value-of select="menu_name" />
                    </option>
                  </xsl:for-each>
                </select>

              </li>
            </xsl:if>

            <li>
              <label>Дата публикации</label>
              <div>
                <table>
                  <tr>
                    <td class="data">
                      <span class="box">
                        <select name="public_day" id="public_day">
                          <xsl:for-each select="$Form/public_day/row">
                            <option value="{id}">
                              <xsl:if test="@active">
                                <xsl:attribute name="selected">selected</xsl:attribute>
                              </xsl:if>
                              <xsl:value-of select="name" />
                            </option>
                          </xsl:for-each>
                        </select>
                        <select name="public_month" id="public_month">
                          <xsl:for-each select="$Form/public_month/row">
                            <option value="{id}">
                              <xsl:if test="@active">
                                <xsl:attribute name="selected">selected</xsl:attribute>
                              </xsl:if>
                              <xsl:value-of select="name" />
                            </option>
                          </xsl:for-each>
                        </select>
                        <select name="public_year" id="public_year">
                          <xsl:for-each select="$Form/public_year/row">
                            <option value="{id}">
                              <xsl:if test="@active">
                                <xsl:attribute name="selected">selected</xsl:attribute>
                              </xsl:if>
                              <xsl:value-of select="name" />
                            </option>
                          </xsl:for-each>
                        </select>
                        <xsl:text> </xsl:text>
                        <select name="public_hour" id="public_hour">
                          <xsl:for-each select="$Form/public_hour/row">
                            <option value="{id}">
                              <xsl:if test="@active">
                                <xsl:attribute name="selected">selected</xsl:attribute>
                              </xsl:if>
                              <xsl:value-of select="name" />
                            </option>
                          </xsl:for-each>
                        </select>
                        <xsl:text>:</xsl:text>
                        <select name="public_min" id="public_min">
                          <xsl:for-each select="$Form/public_min/row">
                            <option value="{id}">
                              <xsl:if test="@active">
                                <xsl:attribute name="selected">selected</xsl:attribute>
                              </xsl:if>
                              <xsl:value-of select="name" />
                            </option>
                          </xsl:for-each>
                        </select>
                      </span>
                    </td>
                  </tr>
                </table>
              </div>
            </li>

     

            <li>
              <label>Заголовок</label>

              <input name="title" type="text" id="title" value="{Main/form/title}" class="broad100"/>

            </li>



            <li>
              <label>Опис</label>

              <textarea name="desc" class="broad100"  id="body2" rows="5">
                <xsl:value-of select="Main/form/desc"/>
              </textarea>

            </li>


          </ul>
        </fieldset>
      </div>

      <div class="submitbox">
        <input name="save" type="submit" style="font-weight: bold;" value="Сохранить" />
        <input name="saveexit" type="submit" value="Сохранить и выйти" />
        <input type="button" value="Отменить" onclick="document.location = '/{$Controller}/'"/>
      </div>
    </form>

    <script type="text/javascript" src="{$Root}/js/tags_auto.js"></script>
  </xsl:template>

</xsl:stylesheet>